//
//  VersionInfoVC.swift
//  XWHAOfflineFitting
//
//  Created by edy on 2024/7/4.
//

import UIKit

class VersionInfoVC: XWHBaseVC {
    
    override var titleText: String {
        "版本信息"
    }
    
    lazy var logoImageView = UIImageView()
    lazy var versionLb = UILabel()
    
    lazy var tipLb = UILabel()

    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    override func setupNavigationItems() {
        super.setupNavigationItems()
        setNav(color: bgColor)
        
        navigationItem.title = titleText
    }
    
    override func addSubViews() {
        super.addSubViews()
        
        view.addSubview(logoImageView)
        view.addSubview(versionLb)
        
        view.addSubview(tipLb)
        
        logoImageView.image = UIImage(named: "")
        
        let lbfont = AppFont.harmonyOSSans(ofSize: 22, weight: .medium)
        versionLb.font = lbfont
        versionLb.textColor = minorTextColor
        versionLb.textAlignment = .center
        versionLb.numberOfLines = 0
        
        tipLb.font = AppFont.harmonyOSSans(ofSize: 20, weight: .bold)
        tipLb.textColor = majorTextColor
        tipLb.textAlignment = .center
        
        largeTitleView.button.isHidden = true
                
        versionLb.text = "V" + AppCheckAppVersion.currentVersion
        tipLb.text = "已是最新版本"
    }
    
    override func relayoutSubViews() {
        logoImageView.snp.makeConstraints { make in
            make.width.equalTo(106)
            make.height.equalTo(106)
            make.top.equalTo(view.safeAreaLayoutGuide.snp.top).offset(80)
            make.centerX.equalToSuperview()
        }
        
        versionLb.snp.makeConstraints { make in
            make.left.right.centerX.equalToSuperview()
            make.top.equalTo(logoImageView.snp.bottom).offset(10)
        }
        
        tipLb.snp.makeConstraints { make in
//            make.left.right.top.height.equalTo(updateBtn)
            make.left.right.height.equalTo(versionLb)
            make.top.equalTo(versionLb.snp.bottom).offset(4)
        }
    }
    
}
